<!DOCTYPE html>
<html>
<head>
	<title>注册</title>
<link rel="stylesheet" href="__ROOT__/static/css/amazeui.min.css">
<script typet="text/javascript" src="__ROOT__/static/js/jquery-3.1.1.min.js"></script>
<script typet="text/javascript" src="__ROOT__/static/js/amazeui.min.js"></script>
</head>
<body>
<form class="am-form">
 <div class="am-form-group"><label for="doc-ipt-email-1">账号：</label>
	<input type="text" class="am-form-field user_no" name="" id="user_no" style="width: 30%" placeholder="请输入账号"></div>
	<div class="am-form-group">
      <label for="doc-ipt-pwd-1">密码：</label>
      <input type="password" class="pwd" name="" id="password" style="width: 30%" placeholder="亲个输入密码"></div>
    <div class="am-form-group">
      <label for="doc-ipt-pwd-1">昵称：</label>
      <input type="text" class="nickname" name="" id="nickname" style="width: 30%" placeholder="请输入昵称"></div>
      <input type="button" name="" value="注册" class="am-btn am-btn-primary register">
      <a href="{:url('login/index')}">去登录</a>
</form>
</body>
<script type="text/javascript">
	$('.register').on('click',function(){
		//alert('a');
		var user_no = $('.user_no').val();
		var pwd = $('.pwd').val();
		var nickname = $('.nickname').val();
		$.ajax({
			url:"{:url('index/login/register_check')}",
			type:"post",
			dataType:"json",
			data:{
				'user_no':user_no,
				'password':pwd,
				'nickname':nickname,
			},
			success:function(data){
				alert(data.msg);
				if(data.code=='0'){
					location.href = data.data.url;
				}
			}
		});
	});
</script>
</html>